package com.ems.sys.dao;
import com.ems.sys.pojo.Role;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/****
 * @Author:传智播客
 * @Description:Role的Dao
 * @Date 2019/6/14 0:12
 *****/
public interface RoleMapper extends Mapper<Role> {
    @Select("select * from roles where rId in (select roleId from users_roles where uId=#{uId})")
    @Results({
            @Result(id = true, property = "rId", column = "rId"),
            @Result(property = "roleName", column = "roleName"),
            @Result(property = "roleDesc", column = "roleDesc"),
    })
    public List<Role> findRoleByUserId(String uId);
}
